- /* simstdbl.cpp by K.Tsuru */
- // function ID = 401 BRADIX
- #ifndef SN_H
- #include "sn.h"
- #endif
- /**************************
- SInteger class
- It sets a double value "d".
- ***************************/
- void SInteger::SetIDouble(double d){
- double x = fabs(d);
- if(x < (double)BRADIX_SQ ){ //under two figures
- SetZero(); //including memory allocation
- if(x < 1.0) return;
-
- ulong L = (ulong)x;
- if(L < (ulong)BRADIX){ //less than BRADIX
- figure[0] = (fType)L; // aHead = aTail = 0
- } else { // x < (double)BRADIX_SQ
- if( (figure[0] = fType(L%BRADIX)) == 0 ) aTail = 1u;
- figure[1] = fType(L/BRADIX); aHead = 1u;
- }
- SetSign(d); return;
- }
-
- SLong a(d);
- *this = ConvToBin(a);
- }
simstdbl.cpp : last modifiled at 2017/03/13 14:32:00(715 bytes)
created at 2016/04/25 14:53:17
The creation time of this html file is 2017/10/25 11:09:45 (Wed Oct 25 11:09:45 2017).